home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1298 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: overload.lbl.gov!news
  2. From: Mikhail Faiguenblat <mfaiguen@issserv4.lbl.gov>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Locaton of an array?
  5. Date: 12 Jan 1996 21:23:18 GMT
  6. Organization: Lawrence Berkeley Laboratory, Berkeley CA
  7. Message-ID: <4d6jg6$4gg@overload.lbl.gov>
  8. References: <4d4iqk$hs3@overload.lbl.gov> <maverickDL1u3x.45I@netcom.com>
  9. NNTP-Posting-Host: issserv4.lbl.gov
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.12 (X11; I; SunOS 5.4 sun4d)
  14. X-URL: news:maverickDL1u3x.45I@netcom.com
  15.  
  16. maverick@netcom.com (Chris Shepard) wrote:
  17. >Hi,
  18. >     Haven't actually coded this in a long time, but try....
  19. >
  20. >#include <the usual stuff>
  21. >
  22. >int main(void)
  23. >{
  24. >    char arr[10],
  25. >              *p;
  26. >
  27. >    p=arr;
  28. >    printf("addr of arr = %p\n",p);
  29. >    return(EXIT_SUCCESS);
  30. >}
  31.  
  32. Hmm, I still think it is not a physical memory address because it gives
  33. numbers like ffffffc0. Is there a register I can look at to find the real
  34. address?
  35.  
  36. >Btw, just  out of curiosity, why do you care where it lives in
  37. >absolute RAM?
  38. >
  39. >     Cheers.
  40. >
  41.  
  42. Well, I have a DOS program (C with inline assembly) which uses DMA to get
  43. images from a camera. The way it was written is that it stores images directly
  44. above first 640K.
  45.  
  46. I have to port this program to Windows, and this means that I can't assume that
  47. this chunk of memory is free--there might be some other program using it.
  48. However, for DMA I must specify a physical address to which data from camera
  49. is copied.
  50.  
  51. What I want to do is to call the function which retrieves a single image
  52. with a pointer to an array, and it would store an image at that location.
  53. That is why I need to know where this array is in RAM.
  54.  
  55. I am not sure if this is the best way, so if anyone can think of something
  56. better I'd appreciate if you let me know.
  57.  
  58. Thanks.
  59.  
  60. MIkhail
  61.  
  62.